package cn.itcast.bos.web.action.transit;

import cn.itcast.bos.domain.transit.InOutStorageInfo;
import cn.itcast.bos.service.transit.InOutStorageInfoService;
import cn.itcast.bos.web.action.common.BaseAction;
import org.apache.struts2.convention.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

@Controller
@Namespace("/")
@ParentPackage("struts-default")
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class InOutStorageInfoAction extends BaseAction<InOutStorageInfo> {

    private String transitInfoId;

    public void setTransitInfoId(String transitInfoId) {
        this.transitInfoId = transitInfoId;
    }

    @Autowired
    private InOutStorageInfoService inOutStorageInfoService;

    @Action(value = "inOutStorageInfo_save",results = {@Result(name = "success",type = "redirect",location = "./pages/transit/transit_info.html")})
    public String save() {
        inOutStorageInfoService.save(model, transitInfoId);
        return SUCCESS;
    }
}
